﻿#pragma once

#include <Eigen/Eigen>
#include <functional>


namespace GOptSolver {

using evaluate_func_type = std::function<double(
    void *, const Eigen::VectorXd &x, Eigen::VectorXd &grad)>;

class BaseSolver {
public:
  virtual ~BaseSolver() = default;
  virtual void set_objective(const evaluate_func_type &objective,
                             void *instance) = 0;
  virtual int minimize(Eigen::VectorXd &x, double &minf) = 0;
};
} // namespace GOptSolver